/*
 * Main.java
 *
 * Created on June 4, 2007, 9:47 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package jmstester;

import java.util.Properties;
import javax.naming.InitialContext;
import usyd.comp5348.OrderFacadeRemote;

/**
 *
 * @author david
 */
public class Main {
    private OrderFacadeRemote orderFacadeBean;
    
    private static final String host = "192.168.1.40";
    
    /** Creates a new instance of Main */
    public Main() {
        try {
            Properties env1 = new Properties();
            env1.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
            env1.setProperty("java.naming.provider.url", "iiop://" + host + ":3700");
            env1.setProperty("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
            env1.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            env1.setProperty("org.omg.CORBA.ORBInitialHost",host);
            env1.setProperty("org.omg.CORBA.ORBInitialPort","3700");
            InitialContext ic1 = new InitialContext(env1);
            orderFacadeBean = (OrderFacadeRemote)ic1.lookup("ejb/Order");
            orderFacadeBean.submitOrder(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new Main();
    }
    
}
